<demo>
基本使用
</demo>
<template>
  <Button @click="showToast1">top</Button>
  <Button @click="showToast2">middle</Button>
  <Button @click="showToast3">bottom</Button>
</template>

<script lang="ts">
import Button from '../../lib/Button.vue'
import { openToast } from '../../lib/toast/plugin'
export default {
  components: {
    Button,
  },
  setup(props) {
    const showToast = (position) => {
      openToast(`你好${parseInt(Math.random() * 100)}`, {
        position,
      })
    }
    const showToast1 = () => {
      showToast('top')
    }
    const showToast2 = () => {
      showToast('middle')
    }
    const showToast3 = () => {
      showToast('bottom')
    }
    return {
      showToast1,
      showToast2,
      showToast3,
    }
  },
}
</script>

<style></style>
